<template>
	<header>
		{{title}}{{titleMsg}}
		<button type="button" @click="changeTitle">改变标题文字</button>
	</header>
</template>

<script>
	export default {
		name: "index_header",
		data() {
			return {
				title: "这个地方是header部分"
			}
		},
		props:{
			titleMsg:{
				type:String,
				required:false
			}
		},
		methods:{
			changeTitle(){
				this.titleMsg = "已经改变！"
			}
		}
	}
</script>

<style scoped>
	header {
		width: 100%;
		height: 40px;
		background: #42B983;
		color: #fff;
		font-size: 25px;
		font-weight: 700;
	}
</style>
